﻿<UserControl x:Class="Gao.Poker.App.Game.GameView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d">
    <TabControl Margin="5" FontSize="14">
        <TabItem Header="比赛信息">
            <ScrollViewer Margin="5" Grid.Column="1" Grid.Row="1">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100"/>
                        <ColumnDefinition Width="300"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <TextBlock Text="比赛名称：" Margin="1" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>
                    <TextBlock Text="{Binding Path=Competition.Name}" Margin="1" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0"/>

                    <TextBlock Text="比赛时间："  Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right"/>
                    <TextBlock Text="{Binding Path=Competition.Date, StringFormat='yyyy-MM-dd'}" VerticalAlignment="Center" Margin="1" Grid.Column="1" Grid.Row="1"/>

                    <TextBlock Text="当前总码数：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="2"/>
                    <TextBlock Text="{Binding Path=Competition.TotalBet, Mode=TwoWay}" Margin="1"  VerticalAlignment="Center" Grid.Column="1" Grid.Row="2"/>

                    <TextBlock Text="买入人数：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="3"/>
                    <TextBlock Text="{Binding Path=Competition.BuyNumber, Mode=TwoWay}"  Margin="1"  VerticalAlignment="Center" Grid.Column="1" Grid.Row="3"/>

                    <TextBlock Text="重新买入人数：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="4"/>
                    <TextBlock Text="{Binding Path=Competition.BuyAgainNumber, Mode=TwoWay}" Margin="1"  VerticalAlignment="Center" Grid.Column="1" Grid.Row="4"/>

                    <TextBlock Text="最后买入人数：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="5"/>
                    <TextBlock Text="{Binding Path=Competition.BuyLastNumber, Mode=TwoWay}" Margin="1"  VerticalAlignment="Center" Grid.Column="1" Grid.Row="5"/>

                    <TextBlock Text="购入筹码：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="6"/>
                    <TextBlock Text="{Binding Path=Competition.Chips, Mode=TwoWay}" Margin="1"  VerticalAlignment="Center" Grid.Column="1" Grid.Row="6"/>

                    <TextBlock Text="保底奖金：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="7"/>
                    <TextBlock Text="{Binding Path=Competition.DownsideBonus, Mode=TwoWay}" Margin="1" VerticalAlignment="Center"  Grid.Column="1" Grid.Row="7"/>

                    <TextBlock Text="买入积分：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="8"/>
                    <TextBlock Text="{Binding Path=Competition.SinglePoints, Mode=TwoWay}" Margin="1" VerticalAlignment="Center"  Grid.Column="1" Grid.Row="8"/>
                    
                    <TextBlock Text="总积分：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="9"/>
                    <TextBlock Text="{Binding Path=Competition.TotalPoints, Mode=TwoWay}" Margin="1" VerticalAlignment="Center"  Grid.Column="1" Grid.Row="9"/>

                    <TextBlock Text="比赛人数上限：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="10"/>
                    <TextBlock Text="{Binding Path=Competition.MaxMember, Mode=TwoWay}" Margin="1" VerticalAlignment="Center"  Grid.Column="1" Grid.Row="10"/>

                    <TextBlock Text="管理费用比例：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="11"/>
                    <TextBlock Text="{Binding Path=Competition.ManCastRatio, Mode=TwoWay}" Margin="1" VerticalAlignment="Center"  Grid.Column="1" Grid.Row="11"/>

                    <TextBlock Text="积分底数：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="12"/>
                    <TextBlock Text="{Binding Path=Competition.DownsidePoints, Mode=TwoWay}" Margin="1" VerticalAlignment="Center"  Grid.Column="1" Grid.Row="12"/>

                    <TextBlock Text="比赛桌号：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="13"/>
                    <TextBlock Text="{Binding Path=Competition.TablesNum, Mode=TwoWay}" Margin="1" VerticalAlignment="Center"  Grid.Column="1" Grid.Row="13"/>

                    <TextBlock Text="比赛级别：" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="14" Grid.ColumnSpan="2"/>
                    <DataGrid Margin="1" Height="200" VerticalAlignment="Top" Grid.Column="1"  Grid.Row="14" Grid.ColumnSpan="2" RowHeight="30"
                            SelectionMode="Single"  CanUserAddRows="True"  AutoGenerateColumns="False" IsReadOnly="True"
                            ItemsSource="{Binding Path=Competition.CompetitionLevels, Mode=TwoWay}" FontSize="16">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="级别" Width="Auto" Binding="{Binding Path=Level, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="比赛时间" Width="80" Binding="{Binding Path=CompetitionTime, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="盲注" Width="120" Binding="{Binding Path=Blind, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="前置休息时间" Width="*" Binding="{Binding Path=AfterRestTime, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="附加前注" Width="*" Binding="{Binding Path=AppendGamble, Mode=TwoWay}"/>
                        </DataGrid.Columns>
                    </DataGrid>

                    <DataGrid Grid.Row="0" Grid.RowSpan="13" Grid.Column="2" Margin="10,1,10,1" RowHeight="30" Name="dgRight" 
                        SelectionMode="Single"  CanUserAddRows="True"  AutoGenerateColumns="False"
                        AlternatingRowBackground="#FFF9CFCF" AlternationCount="2" IsReadOnly="True"
                        ItemsSource="{Binding Path=Competition.Bounses, Mode=TwoWay}"
                        FontSize="16" Height="284">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="名次" Width="60" Binding="{Binding Path=Rank, Mode=TwoWay}"/>
                            <DataGridTextColumn Header="奖金比例%" Width="*" Binding="{Binding Path=Scale, Mode=TwoWay}"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </ScrollViewer>
        </TabItem>
        <TabItem Header="报名情况">
            <DataGrid Margin="1,1,1.2,1" VerticalAlignment="Top" AutoGenerateColumns="False"
                    SelectionMode="Single"  CanUserAddRows="True"
                    ItemsSource="{Binding Members}"  IsReadOnly="True"
                    FontSize="16" Name="dgMembers" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="卡号" Width="100" Binding="{Binding Path=CardNo}"/>
                    <DataGridTextColumn Header="姓名" Width="80" Binding="{Binding Path=Name}"/>
                    <DataGridTextColumn Header="积分" Width="60" Binding="{Binding Path=Points}"/>
                    <DataGridTextColumn Header="座位号" Width="*" Binding="{Binding Path=SeatNum}"/>
                    <DataGridTextColumn Header="买入" Width="40" Binding="{Binding Path=BuyNumber}"/>
                    <DataGridTextColumn Header="重新买入" Width="60" Binding="{Binding Path=BuyAgainNumber}"/>
                    <DataGridTextColumn Header="最后买入" Width="60" Binding="{Binding Path=BuyLastNumber}"/>
                    <DataGridTextColumn Header="金额" Width="60" Binding="{Binding Path=BuyMoney}"/>
                    <DataGridTextColumn Header="名次" Width="40" Binding="{Binding Path=Rank}"/>
                    <DataGridTextColumn Header="奖金" Width="60" Binding="{Binding Path=Bonus}"/>
                    <DataGridTemplateColumn>
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button Width="45" Margin="1" Click="Out_Click" IsEnabled="{Binding Path=Out}" Tag="{Binding Path=CardNo}" Style="{StaticResource Orrange}">出局</Button>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </DataGrid>
        </TabItem>
    </TabControl>
</UserControl>
